package com.ay.wiki_plt.mapper;

import com.ay.wiki_plt.domain.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface UserMapper {


    /*查询全部用户*/
    List<User> list(String name);

    /*批量删除接口*/
    void deleteBatchUser(List<Long> ids);

    /*新增用户*/
    @Insert("insert into user(id, login_name, name, password)VALUES (#{id},#{loginName},#{name},#{password})")
    void insertUser(User req);


    /*修改用户*/
    void updateUser(User req);

    /*根据用户名查询用户是否存在*/
    @Select("select * from user where login_name = #{loginName}")
    User selectByLoginName(String loginName);

    /*重置密码*/
    @Update("update user set password = #{password}")
    void updatePassword(User user);
}
